#基础镜像
FROM ubuntu
MAINTAINER ding xin<1125630273@qq.com>
#将本地Tomcat和jdk加入容器这里放入tar包自动解压
#ADD jdk-8u91-linux-x64.tar.gz /usr/lib
#ADD apache-tomcat-8.5.9.tar.gz /usr/lib
#更新软件源
RUN apt-get update
#安装curl
RUN apt-get -y install curl
#切换目录
WORKDIR /usr/lib/
#下载jdk和Tomcat
RUN curl -L 'http://download.oracle.com/otn-pub/java/jdk/8u131-b11/d54c1d3a095b4ff2b6607d096fa80163/jdk-8u131-linux-x64.tar.gz' -H 'Cookie: oraclelicense=accept-securebackup-cookie; gpw_e24=Dockerfile' | tar -xz
RUN curl -L 'http://archive.apache.org/dist/tomcat/tomcat-8/v8.0.35/bin/apache-tomcat-8.0.35.tar.gz' | tar -xz
#设置jdk和tomcat的环境变量
ENV JAVA_HOME /usr/lib/jdk1.8.0_131
ENV CLASSPATH $JAVA_HOME/lib/dt.jar;$JAVA_HOME/lib/tools.jar
ENV CATALINA_HOME /usr/lib/apache-tomcat-8.0.35
ENV CATALINA_BASE /usr/lib/apache-tomcat-8.0.35
ENV PATH $PATH:$JAVA_HOME/bin:$CATALINA_HOME/lib:$CATALINA_HOME/bin

#设置容器监听的端口
EXPOSE 8080

#设置容器启动后执行的命令

CMD ["catalina.sh", "run"]
